home *** CD-ROM | disk | FTP | other *** search
- property slidermin, slidermax, thumbsprite, barleft, bartop, barright, barbottom, barwidth, barheight, sliderscale
-
- on new me, smin, smax, bleft, btop, bright, bbottom, thumbsp, pos
- set the slidermin of me to smin
- set the slidermax of me to smax
- set the thumbsprite of me to thumbsp
- set the barleft of me to bleft
- set the barright of me to bright
- set the bartop of me to btop
- set the barbottom of me to bbottom
- set the barwidth of me to 1.0 * (bright - bleft)
- set the barheight of me to 1.0 * (bbottom - btop)
- set the sliderscale of me to 1.0 * (the barheight of me / (smax - smin))
- set the locV of sprite thumbsp to btop + ((pos - smin) * the sliderscale of me)
- set the locH of sprite thumbsp to bleft + (the barwidth of me / 2)
- updateStage()
- return me
- end
-
- on movethumb me
- repeat while the stillDown
- set v to the mouseV
- if v > the barbottom of me then
- set posy to the barbottom of me
- else
- if v < the bartop of me then
- set posy to the bartop of me
- else
- set posy to v
- end if
- end if
- set the locV of sprite the thumbsprite of me to posy
- set y to getthumbposition(me)
- set the locV of sprite 2 to 920 - y
- updateStage()
- end repeat
- set y to getthumbposition(me)
- set wk to integer(y) mod 80
- if wk < 40 then
- set y to integer(y) - wk
- else
- set y to integer(y) - wk + 80
- end if
- setthumbposition(me, y)
- set the locV of sprite 2 to 920 - y
- updateStage()
- end
-
- on setthumbposition me, v
- if v > the slidermax of me then
- set v to the slidermax of me
- else
- if v < the slidermin of me then
- set v to the slidermin of me
- end if
- end if
- set y to (the sliderscale of me * v) + the bartop of me
- set the locV of sprite the thumbsprite of me to y
- end
-
- on getthumbposition me
- set w to 1.0 * (the locV of sprite the thumbsprite of me - the bartop of me)
- return (w / the sliderscale of me) + the slidermin of me
- end
-